﻿<UserControl x:Name="_this" x:Class="z.v.Product"
				xmlns:v_sub="clr-namespace:z.v.sub"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
            mc:Ignorable="d" 
            d:DesignHeight="600" d:DesignWidth="800" Loaded="_this_Loaded">
	<Grid>
		<DataGrid x:Name="tbl" LostFocus="tblProduct_LostFocus" AutoGenerateColumns="False">
			<DataGrid.Columns>
				<DataGridTextColumn Binding="{Binding ID}" Header="ID" IsReadOnly="True" Width="Auto"/>
				<DataGridTextColumn Binding="{Binding Code}" Header="Tên(In)" Width="*"/>
				<DataGridTemplateColumn Header="Loại" CanUserSort="True" Width="*">
					<DataGridTemplateColumn.CellEditingTemplate>
						<DataTemplate>
							<v_sub:AutoComplete ClassName="Kind" Tag="{Binding Kind, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
						</DataTemplate>
					</DataGridTemplateColumn.CellEditingTemplate>
					<DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
							<TextBlock Text="{Binding Kind}"/>
						</DataTemplate>
					</DataGridTemplateColumn.CellTemplate>
				</DataGridTemplateColumn>
				<DataGridTemplateColumn Header="Hiệu" CanUserSort="True" Width="*">
					<DataGridTemplateColumn.CellEditingTemplate>
						<DataTemplate>
							<v_sub:AutoComplete ClassName="Brand" Tag="{Binding Brand, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
						</DataTemplate>
					</DataGridTemplateColumn.CellEditingTemplate>
					<DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
							<TextBlock Text="{Binding Brand}"/>
						</DataTemplate>
					</DataGridTemplateColumn.CellTemplate>
				</DataGridTemplateColumn>
				<DataGridTextColumn Binding="{Binding Name}" Header="Tên(Máy)" Width="*"/>
				<DataGridTextColumn Binding="{Binding Price}" Header="Giá" Width="*" CellStyle="{DynamicResource CellRight}"/>
				<DataGridTextColumn Binding="{Binding CurrentPriceIn}" IsReadOnly="True"  Header="Giá mua" Width="*"/>
			</DataGrid.Columns>
		</DataGrid>
	</Grid>
</UserControl>
